package edu.infomatik.tundra.model;

import java.util.Map;
import edu.infomatik.tundra.logic.WorkBean;
import edu.infomatik.tundra.logic.WorkKinds;
import org.apache.tapestry5.OptionModel;

public class ProjectIdOptionModel implements OptionModel {
	
	private WorkBean work;

	public ProjectIdOptionModel(WorkBean work){
		this.work=work;
	}
	@Override
	public Map<String, String> getAttributes() {
		return null;
	}

	@Override
	public String getLabel() {
		return work.getId()+": "+work.getName();
	}

	@Override
	public Object getValue() {
		return work;
	}

	@Override
	public boolean isDisabled() {
		if (work.getKind()==WorkKinds.PROJECT_VALUE)
			return false;
		return true;
	}

}
